﻿namespace YPF.Common.RabbitMQ
{
    /// <summary>
    /// 消息队列存储
    /// </summary>
    public class MqItemInfo
    {
        public string Host { get; set; }
        public string VHost { get; set; }
        public string Port { get; set; }
        public string Password { get; set; }
        public string UserName { get; set; }
        public string QueueName { get; set; }

        public static MqItemInfo LoadConfig()
        {
            var item = new MqItemInfo
            {
                Host = WebConfigurationManager.AppSettings["mq_host"],
                Port = WebConfigurationManager.AppSettings["mq_port"],
                VHost = WebConfigurationManager.AppSettings["mq_vhost"],
                Password = WebConfigurationManager.AppSettings["mq_password"],
                UserName = WebConfigurationManager.AppSettings["mq_username"],
                QueueName = WebConfigurationManager.AppSettings["mq_queuename"]
            };

            return item;
        }
    }
}